from enum import Enum


class ErrorCode(Enum):
    """
    错误码
    """
    PARAM_ERROR = (40001, "参数错误")
    AUTH_FAILED = (40002, "授权失败")
    USER_NOT_FOUND = (40003, "用户不存在")
    SERVER_ERROR = (40004, "服务器内部错误")
    INVALID_FILE_SUFFIX = (40005, "文件类型不支持")
    FILE_SIZE_EXCEEDED = (40006, "文件大小超出限制")

    def __new__(cls, code, msg):
        obj = object.__new__(cls)
        obj.code = code
        obj.msg = msg
        return obj
